package com.magold.algorithm;

public class Node<T> {
	protected T mElement;
	protected Node<T> mLeftNode;
	protected Node<T> mRightNode;
	
	public Node(T element){
		this.mElement = element;
		mLeftNode = null;
		mRightNode = null;
	}
	
	public static <T> void link(Node<T> pLeftNode, Node<T> pRightNode) {
		pLeftNode.mRightNode= pRightNode;
		pRightNode.mLeftNode = pLeftNode;
	}
	
	public void setElement(T pElement) {
		mElement = pElement;
	}
	
	public Node<T> left() {
		return mLeftNode;
	}
	
	public Node<T> right() {
		return mRightNode;
	}
	
	public T element() {
		return mElement;
	}
	
}
